﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using NWN.GDY.Service.Entity;

namespace NWN.GDY.Web.uc
{
    public partial class ucRoomSeat : System.Web.UI.UserControl
    {
        public Seat UserSeat { set; get; }
        public String TableGUID { set; get; }
        public bool Processing { set; get; }
        protected void Page_Load(object sender, EventArgs e)
        {
        }

        public void BindInfo()
        {
            pnlDisabled.Visible = false;
            pnlEnter.Visible = false;
            pnlUserInfo.Visible = false;
            lblStatus.Text = UserSeat.Disabled ? "禁用" : "可用";
            if (UserSeat.OccupiedPlayer != null)
            {
                lblUserName.Text = UserSeat.OccupiedPlayer.NickName;
                pnlUserInfo.Visible = true;
            }
            if (!UserSeat.Disabled)
            {
                hplEnter.Visible = true;
                hplEnter.NavigateUrl = "~/Table.aspx?tid=" + TableGUID + "&sid=" + UserSeat.SeatID.ToString();
                pnlEnter.Visible = true;
            }
            else
            {
                pnlDisabled.Visible = true;
            }
        }
    }
}